﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Animation;

namespace NavigationMVVMDemo
{
    public static class ApplicationDefinitions
    {
        public class ThemeNames
        {
            public const string Theme1 = "Theme1";
            public const string Theme2 = "Theme2";
        }

        public class ThemeURIs
        {
            public static Uri Theme1 
            {
                get
                {
                    return new Uri("Themes/Theme1.xaml", UriKind.Relative);
                }
            }

            public static Uri Theme2
            {
                get
                {
                    return new Uri("Themes/Theme2.xaml", UriKind.Relative);
                }
            }
        }

        public class TransitionAnimations
        {
            private static DoubleAnimation _fadeIn;
            public static DoubleAnimation BuildFadeInAnimation()
            {
                _fadeIn = new DoubleAnimation();
                _fadeIn.BeginTime = new TimeSpan(0, 0, 0, 0, 280);
                _fadeIn.Duration = new Duration(new TimeSpan(0, 0, 0, 0, 280));
                _fadeIn.FillBehavior = FillBehavior.HoldEnd;
                _fadeIn.From = 0;
                _fadeIn.To = 1;
                Storyboard.SetTargetProperty(_fadeIn, new PropertyPath(ContentControl.OpacityProperty));
                   
                return _fadeIn;
            }

            public static DoubleAnimation BuildFadeOutAnimation()
            {
                DoubleAnimation fadeOut = new DoubleAnimation();
                fadeOut.BeginTime = new TimeSpan(0, 0, 0, 0, 0);
                fadeOut.Duration = new Duration(new TimeSpan(0, 0, 0, 0, 280));
                fadeOut.FillBehavior = FillBehavior.HoldEnd;
                fadeOut.From = 1;
                fadeOut.To = 0;
                Storyboard.SetTargetProperty(fadeOut, new PropertyPath(ContentControl.OpacityProperty));
                return fadeOut;
            }
        }
    }
}
